import { createApp } from 'vue'
import router, { setUpRouter } from '@/router'
import { setupVant } from '@/utils/vant'
import { setupStore } from '@/store'
import App from './App.vue'

async function bootstrap() {
  const app = createApp(App)

  // 注册全局常用的 vant 组件
  setupVant(app)

  // 挂载状态管理
  setupStore(app)

  // 挂载路由
  setUpRouter(app)

  // 路由准备就绪后挂载APP实例
  await router.isReady()

  app.mount('#app', true)
}

void bootstrap()
